<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>JCSDK Java API Reference for Android: com.juphoon.cloud.JCPush Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">JCSDK Java API Reference for Android
   &#160;<span id="projectnumber">2.3.3</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.16 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>com</b></li><li class="navelem"><b>juphoon</b></li><li class="navelem"><b>cloud</b></li><li class="navelem"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push.html">JCPush</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">com.juphoon.cloud.JCPush Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span><div class="ingroups"><a class="el" href="group___xE6_x8E_xA8_xE9_x80_x81_xE6_xA8_xA1_xE5_x9D_x97.html">推送模块</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Inherited by com.juphoon.cloud.JCPushImpl.</p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:add956668712ee82af013d4aa3247da6a"><td class="memItemLeft" align="right" valign="top">abstract void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push.html#add956668712ee82af013d4aa3247da6a">addPushInfo</a> (<a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push_template.html">JCPushTemplate</a> info)</td></tr>
<tr class="separator:add956668712ee82af013d4aa3247da6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae1cb8882d69a232056dd35e5037b1659"><td class="memItemLeft" align="right" valign="top">abstract void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push.html#ae1cb8882d69a232056dd35e5037b1659">addPushTemplate</a> (String data)</td></tr>
<tr class="separator:ae1cb8882d69a232056dd35e5037b1659"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a45bedf4eaf788353243979f8f27ac08f"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push.html">JCPush</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push.html#a45bedf4eaf788353243979f8f27ac08f">create</a> (<a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_client.html">JCClient</a> client)</td></tr>
<tr class="separator:a45bedf4eaf788353243979f8f27ac08f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeccaad1773aa6bb085c193ebe81941ff"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push.html#aeccaad1773aa6bb085c193ebe81941ff">destroy</a> ()</td></tr>
<tr class="separator:aeccaad1773aa6bb085c193ebe81941ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a8b9aab0b906c2400e42be20187a50e1e"><td class="memItemLeft" align="right" valign="top"><a id="a8b9aab0b906c2400e42be20187a50e1e"></a>
abstract void&#160;</td><td class="memItemRight" valign="bottom"><b>destroyObj</b> ()</td></tr>
<tr class="separator:a8b9aab0b906c2400e42be20187a50e1e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>用于管理推送 </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a45bedf4eaf788353243979f8f27ac08f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a45bedf4eaf788353243979f8f27ac08f">&#9670;&nbsp;</a></span>create()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push.html">JCPush</a> com.juphoon.cloud.JCPush.create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_client.html">JCClient</a>&#160;</td>
          <td class="paramname"><em>client</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>创建 <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push.html">JCPush</a> 对象</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">client</td><td><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_client.html">JCClient</a> 对象 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>返回 <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push.html">JCPush</a> 对象 </dd></dl>

</div>
</div>
<a id="aeccaad1773aa6bb085c193ebe81941ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeccaad1773aa6bb085c193ebe81941ff">&#9670;&nbsp;</a></span>destroy()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void com.juphoon.cloud.JCPush.destroy </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>销毁 <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push.html">JCPush</a> 对象 </p>

</div>
</div>
<a id="add956668712ee82af013d4aa3247da6a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#add956668712ee82af013d4aa3247da6a">&#9670;&nbsp;</a></span>addPushInfo()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">abstract void com.juphoon.cloud.JCPush.addPushInfo </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push_template.html">JCPushTemplate</a>&#160;</td>
          <td class="paramname"><em>info</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">abstract</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>添加推送模板，用于服务器将不同类型的推送以不同的内容格式推给客户端</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">info</td><td>推送信息 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ae1cb8882d69a232056dd35e5037b1659"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae1cb8882d69a232056dd35e5037b1659">&#9670;&nbsp;</a></span>addPushTemplate()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">abstract void com.juphoon.cloud.JCPush.addPushTemplate </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">abstract</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>自定义添加推送模板</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>模版数据</td></tr>
  </table>
  </dd>
</dl>
<p>生成小米推送参数，格式如下: { // Token 模板 "Notify.MiPush.AppId":"Justalk cloud 上注册的该应用的小米Push AppPackage 值", "Notify.MiPush.RegId":"小米推送注册成功返回的 regId", // 通话模板 "Notify.MiPush.Invite.Payload":"{                                // 在音视频通话业务中推送包含的内容
                                      "calltype":"${MediaType}",     // ${MediaType} 表示服务器传入的呼叫类型（视频或音频）
                                      "caller":"${Caller}",          // ${Caller}    表示主叫号码
                                      "callid":"${CallId}",          // ${CallId}    表示服务器生成的 callId
                                      "to":"自身唯一标识符，可以用登录的账号作为唯一标识符",
                                      "resend":"${ResendIndex}"      // ${ResendIndex} 表示服务器返回的第几次重发
                                      }", "Notify.MiPush.Invite.Expiration": "推送过期时间，单位秒", "Notify.MiPush.Invite.Title":"${Caller}", // ${Caller} 表示在通知栏展示的标题 "Notify.MiPush.Invite.Description":"${Text}", // ${Text} 表示在通知栏展示的描述 "Notify.MiPush.Invite.PassThrough": "设置消息是否通过透传方式值App", // "1"表示透传消息，"0"表示非透传消息 "Notify.MiPush.Invite.ResendCount": "推送内容重发次数，会加1", //例如填5，则会发送6次 "Notify.MiPush.Invite.ResendTimeout": "推送通知重发的超时时间，即每次重发的时间间隔", // 消息模板 "Notify.MiPush.Message.Info.Text.Title":"${Sender}", // ${Caller} 表示在通知栏展示的标题 "Notify.MiPush.Message.Info.Text.Description":"${Text}", // ${Text} 表示在通知栏展示的描述 "Notify.MiPush.Message.Info.Text.Payload":"{                            // 在音视频通话业务中推送包含的内容
                                                 "sender": "${Sender}",      // ${Sender} 表示服务器传入的消息发送者
                                                 "text": "${Text}",          // ${Text}   表示在通知栏展示的描述
                                                 "to":"自身唯一标识符，可以用登录的账号作为唯一标识符"
                                                 }", "Notify.MiPush.Message.Info.Text.Expiration": "推送过期时间，单位秒", "Notify.MiPush.Message.Info.Text.PassThrough": "设置消息是否通过透传方式值App" // "1"表示透传消息，"0"表示非透传消息 } // 注意事项： 1.Notify.MiPush.Message.Info.Text.Title 中的 Text 可自定义。发消息时，方法中 messageType 消息类型这个参数必须与这个值保持一致才能收到推送消息</p>
<p>生成华为推送参数，格式如下: { // Token 模板 "Notify.HMSPush.AppId":"Justalk cloud 上注册的该应用的华为Push 的 AppId 值", "Notify.HMSPush.Token":"华为推送注册成功返回的 token", // 通话模板 "Notify.HMSPush.Invite.Payload":{ // 在音视频通话业务中推送包含的内容 "calltype":"${MediaType}", // ${MediaType} 表示服务器传入的呼叫类型（视频或音频） "caller":"${Caller}", // ${Caller} 表示主叫号码 "callid":"${CallId}", // ${CallId} 表示服务器生成的 callId "to":"自身唯一标识符，可以用登录的账号作为唯一标识符", "resend":"${ResendIndex}" // ${ResendIndex} 表示服务器返回的第几次重发 }, "Notify.HMSPush.Invite.Expiration": "推送过期时间，单位秒", "Notify.HMSPush.Invite.AndroidMessage":{ // 当 passThrough 为 "0" 时，填华为的通知栏模版 json, 参考华为官方文档 "type": 3, "body": { "content": "${Caller}", "title": "来电" }, "action": { "type": 1, "param": { "intent": "intent://com.juphoon.cloud.sample/MainActivity#Intent;scheme=customscheme;launchFlags=0x14000000;B.isFromPush=true;S.ContactNumber=${Caller};end" } } } "Notify.HMSPush.Invite.PassThrough": "设置消息是否通过透传方式值App", // "1"表示透传消息，"0"表示非透传消息 "Notify.HMSPush.Invite.ResendCount": "推送内容重发次数，会加1", //例如填5，则会发送6次 "Notify.HMSPush.Invite.ResendTimeout": "推送通知重发的超时时间，即每次重发的时间间隔", // 消息模板 "Notify.HMSPush.Message.Info.Text.Payload":"{                           // 在音视频通话业务中推送包含的内容
                               "sender":"${Sender}",                         // ${Sender} 表示服务器传入的消息发送者
                               "text":"${Text}",                             // ${Text}   表示在通知栏展示的描述
                               "to":"自身唯一标识符，可以用登录的账号作为唯一标识符"
                               }", "Notify.HMSPush.Message.Info.Text.Expiration": "推送过期时间，单位秒", "Notify.HMSPush.Message.Info.Text.AndroidMessage":"{                   // 当 passThrough 为 "0" 时，填华为的通知栏模版 json, 参考华为官方文档
                 "type": 3,
                 "body": {
                     "content": "${Caller}",
                     "title": "来电" }, "action": { "type": 1, "param": { "intent": "intent://com.juphoon.cloud.sample/MainActivity#Intent;scheme=customscheme;launchFlags=0x14000000;B.isFromPush=true;S.ContactNumber=${Caller};end" } } }",
     "Notify.HMSPush.Message.Info.Text.PassThrough": "设置消息是否通过透传方式值App"  // "1"表示透传消息，"0"表示非透传消息 } // 注意事项： 1.Notify.HMSPush.Message.Info.Text.Title 中的 Text 可自定义。发消息时，方法中 messageType 消息类型这个参数必须与这个值保持一致才能收到推送消息 2.Notify.HMSPush.Invite.Payload 和 Notify.HMSPush.Invite.AndroidMessage 其实作用是一样， 当 Notify.HMSPush.Invite.PassThrough 值为1时 Notify.HMSPush.Invite.Payload 生效， 相反 Notify.HMSPush.Invite.PassThrough 值为0时 Notify.HMSPush.Invite.AndroidMessage 生效</p>
<p>生成Google通话推送参数，格式如下: { // Token 模板 "Notify.GCM.SenderId":"Justalk cloud 上注册的该应用的GCM的senderId值", "Notify.GCM.RegId":"GCM注册成功返回的regid", // 通话模板 "Notify.GCM.Invite.Payload":"{                                    // 在音视频通话业务中推送包含的内容
                                     "calltype": "${MediaType}",     // ${MediaType} 表示服务器传入的呼叫类型（视频或音频）
                                     "caller": "${Caller}",          // ${Caller}    表示主叫号码
                                     "callid": "${CallId}",          // ${CallId}    表示服务器生成的 callId
                                     "to":"自身唯一标识符，可以用登录的账号作为唯一标识符",
                                     "resend":"${ResendIndex}"       // ${ResendIndex} 表示服务器返回的第几次重发
                                     }", "Notify.GCM.Invite.Expiration": "推送过期时间，单位秒", "Notify.GCM.Invite.ResendCount": "推送内容重发次数，会加1", //例如填5，则会发送6次 "Notify.GCM.Invite.ResendTimeout": "推送通知重发的超时时间，即每次重发的时间间隔" // 消息模板 "Notify.GCM.Message.Info.Text.Payload":"{                           // 在音视频通话业务中推送包含的内容
                                              "sender": "${Sender}",     // ${Sender} 表示服务器传入的消息发送者
                                              "text":"${Text}",          // ${Text}   表示在通知栏展示的描述
                                              "to":"自身唯一标识符，可以用登录的账号作为唯一标识符", "resend":"${ResendIndex}" // ${ResendIndex} 表示服务器返回的第几次重发 }",
     "Notify.GCM.Message.Info.Text.Expiration": "推送过期时间，单位秒",
     "Notify.GCM.Message.Info.Text.ResendCount": 推送内容重发次数，会加1", //例如填5，则会发送6次 "Notify.GCM.Message.Info.Text.ResendTimeout": "推送通知重发的超时时间，即每次重发的时间间隔", "Notify.GCM.Message.Info.Text.PassThrough": "设置消息是否通过透传方式值App" // "1"表示透传消息，"0"表示非透传消息" } // 注意事项： 1.Notify.GCM.Message.Info.Text.Expiration 中的 Text 可自定义。发消息时，方法中 messageType 消息类型这个参数必须与这个值保持一致才能收到推送消息 </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>cloud/src/main/common/com/juphoon/cloud/JCPush.java</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
